package com.ldy.core.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ldy.core.entity.BaseUser;

public interface BaseUserMapper extends BaseMapper<BaseUser>{

	@Select("<script>"
			+ "select * from base_user t where 1=1 "
			  + "<if test='username !=null and username != \"\"'>and t.username like CONCAT('%',#{username},'%') </if>"
			  + "<if test='nickname !=null and nickname != \"\"'>and t.nickname like CONCAT('%',#{nickname},'%') </if>"
			   + " order by t.create_time desc"
              + "</script>")
	List<BaseUser> selectPageList(Page<BaseUser> page, @Param("username") String username,  @Param("nickname") String nickname);

}
